<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>赤焰信息小程序管理系统 - 基本表单</title>
    <meta name="keywords" content="赤焰信息小程序管理系统">
    <meta name="description" content="赤焰信息小程序管理系统">

    <link rel="shortcut icon" href="favicon.ico"> <link href="${path}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="${path}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${path}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${path}/css/animate.min.css" rel="stylesheet">
    <link href="${path}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">

<div class="col-sm-12">
<div class="ibox float-e-margins">
    <div class="ibox-title">
        
        <div class="ibox-tools" >
             <button class="btn btn-white"  data-dismiss="modal"><i class="fa fa-times"></i></button>
        </div>
    </div>
    <div class="ibox-content">
        <form method="post" class="form-horizontal" action="#" id="form-area">
        
        	<input type="hidden" id="" name="${seqId!"seqId"}" value="${seqIdValue!""}"/>
        	<#list fields?keys as field>
	        	<#list captions?keys as caption>
	        		<#if field==caption>
			            <div class="form-group">
			                <label class="col-sm-2 control-label">${captions[caption]!("null")}</label>
			                <div class="col-sm-10">
			                    <input type="text" value="${fields[field]!("null")}" name="${field }"  class="form-control"  required  data-bv-notempty-message="输入内容不能为空">
			                </div>
			            </div>
			        </#if> 
	            </#list>
             </#list>
             <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                  	<button class="btn btn-primary"  onclick="submitFunction()" id="submit-type">保存内容</button>
                    <button class="btn btn-white"  data-dismiss="modal">取消</button>
                </div>
            </div>
        </form>
    </div>
</div>



</body>
<script type="text/javascript">
	
</script>


<script src="${path}/js/jquery.min.js?v=2.1.4"></script>
<script src="${path}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${path}/js/content.min.js?v=1.0.0"></script>
<script src="${path}/js/plugins/iCheck/icheck.min.js"></script>
<script type="text/javascript">
function submitFunction() {
	var form = new FormData($('#form-area')[0]);
	
	$.ajax({
        url: '/pc/${lowercaseBean}/addOrUpdate.do',
        async: false,//同步，会阻塞操作
        type: 'POST',//PUT DELETE POST
        data: form,
        processData: false,
        contentType: false,
        dataType:'json',
        success: function (result) {
            alert(result.msg);
            if (result.code=="0") {
            	window.location.reload();//刷新当前页面
            	//$("#addModal").modal('hide');
            	return true;
            } else {
            	alert(result.msg);
            	return false;
            }
        }, error: function () {
            alert("失败");
            return false;
        }
    });
}
</script> 

</html>
